package net.xinqushi.design.templateMethod.core;


public abstract class SocketMessageSender extends AbstractMessageSender{

	protected int readBufferSize = DefaultSetting.BUFFER_SIZE;  

	protected int writeBufferSize = DefaultSetting.BUFFER_SIZE;  

	protected int waitTimeout=DefaultSetting.CONNECT_WAIT_TIME;
	
	protected int readTimeout=DefaultSetting.SOCKET_READ_TIMEOUT;

	protected volatile String host=null;

	protected volatile int port;

	protected boolean initialized=false;

	public SocketMessageSender(String host,int port,String username, String password) {
		super(username, password);
		this.host=host;
		this.port=port;
	}

	public void setReadBufferSize(int size) {
		readBufferSize=size;
	}

	public void setWriteBufferSize(int size) {
		writeBufferSize=size;
	}

	public int getWaitTimeout() {
		return waitTimeout;
	}

	public void setWaitTimeout(int waitTimeout) {
		this.waitTimeout = waitTimeout;
	}

	public int getReadTimeout() {
		return readTimeout;
	}

	public void setReadTimeout(int readTimeout) {
		this.readTimeout = readTimeout;
	}

}
